<?php 
	namespace app\admin\controller;
	use think\facade\Session;
	use \think\DB;
	class Login extends \think\Controller{
		public function login(){
			return $this->fetch();
		}
		public function examin(){
			$data = array(
				"admin_name" => $_POST['ad_name'],
				"admin_password" => md5($_POST['ad_pwd'])
			);
			$val = DB::name("admin")->where($data)->find();
			if($val){
				Session::set("isLogin",1);
				Session::set("admin",$_POST['ad_name']);
				$this->redirect("admin/index");
			}
			return $this->redirect("login");
		}
	}
	
?>